package com.jxtpro.generator;

import javax.sql.DataSource;

import com.jfinal.plugin.druid.DruidPlugin;

public class TestGenerator {

	public static void main(String[] args) {
		JxtProGenerator gen = new JxtProGenerator();
		try {
			gen.gen2M2C(getDataSource());
		} catch (Exception e) {
			System.out.println("-- gen error  --  ");
			e.printStackTrace();
		}
	}
	
	public static DataSource getDataSource(){
		DruidPlugin dp = new DruidPlugin("jdbc:mysql://127.0.0.1/test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true", "root", "123456");
		dp.start();
		return dp == null ? null: dp.getDataSource();
	}
}
